<?php

class StudentTransfer_Form_Demove extends StudentTransfer_Form_Transfer
{

    public function init()
    {
        parent::init();

        $this->getElement('causation_kind')->setOptions(array('required'=>false));
        // 學校名稱縣市可為 null
        $this->getElement('school_name')->setOptions(array('required'=>false));
        $this->getElement('county')->setOptions(array('required'=>false));

        $semester = new Semester_Model_SemesterClass();
        $className = $semester->getGradeClassNames();
        $className = array_merge(array(''=>'choose a class'),$className);
        // 班級
        $this->addElement('select','selClass',array(
            'label'     => 'transfer to class',
            'required' => true,
            'multiOPtions' => $className
        ));
        // 學生
        $studentArr = array(''=>'choose a student');
        $this->addElement('select','studentSn',array(
            'label'     => 'student name',
            'required' => true,
            'multiOPtions' => $studentArr,
        ));
        // 升降班級
        $this->addElement('select','toClass',array(
            'label'     => 'choose to class',
            'required' => true,
            'multiOPtions' => array(''=>'choose a class')
        ));
        $this->setElementsBelongTo('demove');

        $this->getElement('studentSn')->setRegisterInArrayValidator(false);
        $this->getElement('toClass')->setRegisterInArrayValidator(false);
    }
}